package com.laoxu.student.business.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.laoxu.student.business.entity.Class;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.laoxu.student.business.vo.ClassVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 班级 Mapper 接口
 * </p>
 *
 * @author Laoxu
 * @since 2020-04-04
 */
public interface ClassMapper extends BaseMapper<Class> {
    /**
     *
     * @param page 前端传入
     * @return
     */
    @Select("SELECT c.*,d.dept_name, m.major_name " +
            "FROM tb_class c " +
            "left join tb_major m on c.major_id=m.id " +
            "left join tb_department d on c.dept_id=d.id "
            )
    List<ClassVO> selectClassList(Page page);
}
